#ifndef DEBUGWINDOW_H
#define DEBUGWINDOW_H

#include <QMainWindow>
#include "mainwindow.h"
#include <string>
#include <vector>
#include "threadqueue.h"
#include <opencv2/opencv.hpp>
using std::string;
using std::vector;

class MainWindow;

namespace Ui {
class DebugWindow;
}

class MainWindow;

class DebugWindow : public QMainWindow
{
    Q_OBJECT

public:
    explicit DebugWindow(MainWindow *parent = 0, int ID = 0);
    ~DebugWindow();
    void closeEvent(QCloseEvent *event);
    vector<vector<string>> messages;
    ThreadQueue<vector<string> > messageQueue;
    vector<QByteArray> images;
    QImage putImage(const cv::Mat& mat);
    void addMessage(vector<string> message);
private slots:
    void on_exitButton_clicked();

    void on_sendCommandButton_clicked();

    void on_btnDebugInfo_clicked();

    void on_btnDebugImages_clicked();

    void on_commandEdit_returnPressed();

    void on_ClearAllButton_clicked();

    void on_SaveImageButton_clicked();

private:
    Ui::DebugWindow *ui;
    MainWindow * mainWindowP;
    int botnum;
    //NetworkWrapper net;

    void waitAndProcessReturns();
    inline void processDebugInfo();
};

#endif // DEBUGWINDOW_H




